const {defineConfig} = require('@vue/cli-service')
const path = require('path')

function resolve(dir) {
    return path.join(__dirname, dir)
}

module.exports = defineConfig({
    transpileDependencies: true,
    productionSourceMap: false,
    devServer: {
        proxy: {
            '/baidu': {
                target: 'https://pan.baidu.com/rest/2.0/xpan/',
                changeOrigin: true,
                pathRewrite: {
                    '^/baidu': ''
                }
            },
            '/fileDown': {
                target: 'https://d.pcs.baidu.com/file/',
                changeOrigin: true,
                pathRewrite: {
                    '^/fileDown': ''
                }
            }
        }
    },
    chainWebpack: (config) => {
        config.resolve.alias.set('@', resolve('src'))
    }
})
